Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Partition calls from Jinja context #30019

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

In #28122, all methods that take a table_name and a schema were updated to received a Table instance. Unfortunately, the Jinja context calls to partition methods were not updated breaking the functionality. This PR fixes the problem by making the necessary changes.

It's not in the scope of this PR to potentially support catalogs, which was the reason for the Table instance changes but this might be needed. @betodealmeida

TESTING INSTRUCTIONS

CI should be sufficient.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the global:jinja Related to Jinja templating label Aug 26, 2024
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.69%. Comparing base (76d897e) to head (1fa333e).
Report is 635 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #30019       +/-   ##
===========================================
+ Coverage   60.48%   83.69%   +23.20%     
===========================================
  Files        1931      528     -1403     
  Lines       76236    38207    -38029     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31976    -14138     
+ Misses      28017     6231    -21786     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.92% <100.00%> (-0.24%) ⬇️
javascript ?
mysql 76.75% <100.00%> (?)
postgres 76.84% <100.00%> (?)
presto 53.48% <100.00%> (-0.32%) ⬇️
python 83.69% <100.00%> (+20.20%) ⬆️
sqlite 76.31% <100.00%> (?)
unit 60.29% <100.00%> (+2.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mistercrunch
Copy link
Member

mistercrunch commented Aug 26, 2024

OMG will that fix the little <well/> under the table metadata component in SQL Lab!?

There's a feature request to apply WHERE {partition_column} = {{latest_partition(table_name)}} for the data preview pane in SQL Lab too, not sure if it ever worked that way and this will fix it or whether it never got done, we'll see.

@michael-s-molina
Copy link
Member Author

michael-s-molina commented Aug 27, 2024

OMG will that fix the little under the table metadata component in SQL Lab!?

@mistercrunch Did you mean litter or forgot to specify what's little? 😄

@mistercrunch
Copy link
Member

Ooops, I wrote "little <well/>" but the html got swallowed, needed backticks...

Copy link
Member

@sadpandajoe sadpandajoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michael-s-molina michael-s-molina merged commit 07a90ad into apache:master Aug 27, 2024
73 of 74 checks passed
@sadpandajoe sadpandajoe added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Aug 27, 2024
sadpandajoe pushed a commit that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
global:jinja Related to Jinja templating size/XS v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants